#!/bin/bash

# 获取当前系统的IP地址
IP_ADDRESS=$(hostname -I)

# 启动redis
nohup redis-server --bind 0.0.0.0 --port 6379 --requirepass x2023#RThree > /dev/null 2>&1 &

# 启动pgsql
mkdir -p /var/run/postgresql/
chown -R postgres:postgres /var/lib/pgsql/data
chown postgres:postgres /var/run/postgresql/
chmod 0700 /var/lib/pgsql/data
su - postgres -c "pg_ctl -D /var/lib/pgsql/data start"

# 运行服务
/opt/jdk-11.0.21/bin/java -jar /data/easy-digital-app-0.0.1-SNAPSHOT.jar